package me.zhengjie.modules.insurance.pojo;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 案件申请请求
 *
 * @author HeHui
 * @date 2022-01-03 21:57
 */
@Data
public class InsuredApplyRequest implements Serializable {

    private static final long serialVersionUID = -2810152605867752898L;

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "案件申请人ID")
    private Long insuredUserId;

    @ApiModelProperty(value = "案件所属公司ID")
    @NotNull(message = "请选择公司")
    private Long companyId;

    @ApiModelProperty(value = "案件所属公司站点ID")
    @NotNull(message = "请选择公司站点")
    private Long companySiteId;

    @ApiModelProperty(value = "站长姓名")
    private String siteUserName;

    @ApiModelProperty(value = "站长手机")
    private String siteUserMobile;

    @ApiModelProperty(value = "报案号")
    private String reportNo;

    @ApiModelProperty(value = "保单号")
    private String policyNo;

    @ApiModelProperty(value = "骑手名称")
    @NotNull(message = "请输入骑手姓名")
    private String userName;

    @ApiModelProperty(value = "出险人手机号码")
    @NotBlank(message = "请输入骑手手机号码")
    private String userMobile;

    @Column(name = "user_id_card",nullable = false)
    @NotBlank(message = "请输入骑手身份证")
    @ApiModelProperty(value = "骑手身份证")
    private String userIdCard;

    @ApiModelProperty(value = "理赔对象，1骑手,2公司,3三者")
    private Integer claimType = 1;

    @ApiModelProperty(value = "责任判断ids")
    private String responsibilityIds;

    @ApiModelProperty(value = "有无附加险")
    private Integer additional;


    @ApiModelProperty(value = "事故发生时间")
    private Date accidentDate;

    @ApiModelProperty(value = "出险类型")
    private List<Integer> accidentTypeIds;

    @ApiModelProperty(value = "事故区域code")
    private List<String> accidentRegionCode;

    @ApiModelProperty(value = "事故地址")
    private String accidentAddress;

    @ApiModelProperty(value = "事故说明")
    private String accidentDesc;

    @ApiModelProperty(value = "理赔员ID，后台用户ID")
    private Long responsibleUserId;

    private List<String> fileList;



    public Boolean submitOver() {
        return  StrUtil.isNotBlank(accidentDesc) && StrUtil.isNotBlank(accidentAddress)
            && responsibleUserId != null && responsibleUserId > 0  && CollUtil.isNotEmpty(accidentRegionCode)
            && accidentDate != null;
    }

}
